package com.yf.zzmusic.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yf.zzmusic.pojo.dto.musicCollectRecord.MusicCollectRecordDeleteDTO;
import com.yf.zzmusic.pojo.entity.MusicCollectRecord;
import com.yf.zzmusic.mapper.MusicCollectRecordMapper;
import com.yf.zzmusic.service.IMusicCollectRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 歌单记录表，为减少music_collec表的数据的冗余 服务实现类
 * </p>
 *
 * @author
 * @since 2024-02-26
 */
@Service
public class MusicCollectRecordServiceImpl extends ServiceImpl<MusicCollectRecordMapper, MusicCollectRecord> implements IMusicCollectRecordService {

  @Override
  public boolean deleteMusicCollectRecordByMusicId(Integer musicId) {
    QueryWrapper<MusicCollectRecord> queryWrapper=new QueryWrapper<>();
    queryWrapper.eq("music_id",musicId);
    return remove(queryWrapper);
  }

  @Override
  public boolean deleteMusicCollectRecordByMusicCollectId(Integer musicCollectId) {
    QueryWrapper<MusicCollectRecord> queryWrapper=new QueryWrapper<>();
    queryWrapper.eq("music_collect_id",musicCollectId);
    return remove(queryWrapper);
  }
}
